package cn.xfdzx.android.apps.shop.contract;

import cn.xfdzx.android.apps.shop.base.BaseView;
import cn.xfdzx.android.apps.shop.bean.BaseObjectBean;
import cn.xfdzx.android.apps.shop.bean.LogininfoBean;
import io.reactivex.Flowable;


/**
 * @author azheng
 * @date 2018/6/4.
 * Description：
 * 其他登录和微信登录
 */

public interface OtherLoginContract {
    interface Model {

        Flowable<LogininfoBean> loginCode(String mobile, String code);

        Flowable<LogininfoBean> sendSms(String mobile,String code_type);

        Flowable<LogininfoBean> checkBindPhone(String code);

        Flowable<LogininfoBean> wechatLogin(String hash,String mobile,String smsCode);

    }

    interface View extends BaseView {
        @Override
        void showLoading();

        @Override
        void hideLoading();

        @Override
        void onError(Throwable throwable);

        void onLoginCodeSuccess(LogininfoBean bean);

        void onSendSmsSuccess(LogininfoBean bean);

        void onCheckBindPhoneSuccess(LogininfoBean bean);

        void wechatLoginSuccess(LogininfoBean bean);

    }

    interface Presenter {

        /**
         * 手机验证码登陆
         *
         * @param mobile
         * @param code
         */
        void loginCode(String mobile, String code);

        /**
         * 发送手机验证码
         *
         * @param mobile
         */
        void sendSms(String mobile,String code_type);

        /**
         * 检测APP微信登录是否绑定手机号
         *
         * @param code
         */
        void checkBindPhone(String code);

        /**
         * APP微信登录
         *
         * @param hash
         * @param mobile
         */
        void wechatLogin(String hash,String mobile,String smsCode);


    }
}
